/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package medidas;

import java.util.Scanner;
public class Centimetros_Pulgadas {

       public static void main( String args[] ){
       Scanner leer = new Scanner(System.in);
        
       
       int CM;
       int pul;
       int op;
       double RES;
        
       System.out.println( "Ingrese la operacion" );
       System.out.println( "1.- Centimetos a pulgadas" );
       System.out.println( "2.- Pulgadas a centimetros" );
       System.out.println( "\n" );
       op = leer.nextInt();
        
       switch (op){
                   case 1:
                          System.out.println( "Centimetros a pulgadas" );
                          System.out.println( "Ingrese los centimetros" );
                          CM = leer.nextInt();
                          RES = CM / 2.54;
                          System.out.println( "El resultado es: "+RES+" pulgadas" );
                          break;
                   case 2:
                          System.out.println( "Pulgadas a centimetros" );
                          System.out.println( "Ingrese el numero de pulgadas" );
                          pul = leer.nextInt();
                          RES = pul * 2.54;
                          System.out.println( "El resultado es: "+RES+" centimetros" );
                          break;
                 
                  }
       }
}
 

